home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.04 Apr 95 / TreeAppƒ / Application Shellƒ / CPPTreeApp.cp < prev    next >
Encoding:
Text File  |  1996-04-04  |  3.1 KB  |  126 lines  |  [TEXT/KAHL]

  1. /********************************************************* DEFINITION
  2.     DATE:    10/12/93
  3.     
  4.     CLASS:  CPPTreeApp
  5.     
  6.     SUPERCLASS: CPPApplication
  7.     
  8.         This C++ class defines the backbone for the TestSA
  9.         application.
  10.         
  11.                
  12. ********************************************************************/
  13.  
  14. #include "CPPTreeApp.h"
  15. #include "CPPTreeAppMenuBar.h"
  16. #include "CPPString.h"
  17. #include "MyCommands.h"
  18. #include <CPPWindowManager.h>
  19. #include <FileTools.h>
  20. #include <StringTools.h>
  21. #include <GraphicsTools.h>
  22. #include <CPPTreeArea.h>
  23. #include <CPPVisualTree.h>
  24. #include <CPPVisualTreeNode.h>
  25. #include <CPPPackedTreeNode.h>
  26. #include <CPPDRequest.h>
  27. #include "CPPTreeAppAboutBox.h"
  28.  
  29. #include <Commands.h>
  30.  
  31. #include    <CPPStringList.h>
  32.  
  33. extern    CPPMenuBar            *gMenuBar;
  34. extern    CPPWindowManager    *gWindowManager;
  35.  
  36.  
  37. /*-----------------------------------------------------------------*/
  38. /*------------------------ PUBLIC METHODS -------------------------*/
  39. /*-----------------------------------------------------------------*/
  40.  
  41.     CPPTreeApp::CPPTreeApp (void) : CPPApplication ()
  42.     {
  43.  
  44.     }
  45.  
  46. /*-----------------------------------------------------------------*/
  47.  
  48.     CPPTreeApp::~CPPTreeApp (void)
  49.     {
  50.  
  51.     }
  52.  
  53. /*-----------------------------------------------------------------*/
  54.  
  55.     Boolean    CPPTreeApp::Member (char *className)
  56.     {
  57.         if (strcmp(className, CPPTreeApp::ClassName()) == 0)
  58.           return TRUE;
  59.         else
  60.           return CPPApplication::Member(className);
  61.     }
  62.     
  63. /*-----------------------------------------------------------------*/
  64.  
  65.     char    *CPPTreeApp::ClassName (void)
  66.     {
  67.         return "CPPTreeApp";
  68.     }
  69.  
  70. /*-----------------------------------------------------------------*/
  71. /*----------------------- PROTECTED METHODS -----------------------*/
  72. /*-----------------------------------------------------------------*/
  73.  
  74.     void    CPPTreeApp::BuildMenuBar (void)
  75.     {
  76.         gMenuBar = new CPPTreeAppMenuBar ();
  77.     }
  78.  
  79. /*-----------------------------------------------------------------*/
  80.  
  81.     void    CPPTreeApp::DoApplicationSetup(void)
  82.     /* initialize application globals */
  83.     {
  84.         CPPString    *STemp = new CPPString (String2String("\pROOT"), TRUE);
  85.         CPPVisualTreeNode    *TheNode = NULL;
  86.         CPPPackedTreeNode    *PTreeNode = NULL;
  87.                 
  88.         TreeWindow = new CPPTreeWindow (gWindowManager, 1316);
  89.         TheNode = new CPPVisualTreeNode (STemp, TreeWindow->theTreeArea, TRUE, FALSE);
  90.         TreeWindow->theTreeArea->SetTopMostNode (TheNode);
  91.         TreeWindow->theTreeArea->ForceResize(TRUE);
  92.         
  93.         PTreeWindow = new CPPPackedTreeWindow (gWindowManager, 1317);
  94.         PTreeNode = new CPPPackedTreeNode (STemp, TreeWindow->theTreeArea, TRUE, FALSE);
  95.         PTreeWindow->theTreeArea->SetTopMostNode (PTreeNode);
  96.         PTreeWindow->theTreeArea->ForceResize(TRUE);
  97.     }
  98.  
  99. /*-----------------------------------------------------------------*/
  100.  
  101.     void    CPPTreeApp::DoApplicationShutDown(void)
  102.     /* close the communication port and get rid of the sound objects */
  103.     /* The window manager will clean up our windows */
  104.     {
  105.  
  106.     }
  107.     
  108. /*-----------------------------------------------------------------*/
  109.  
  110.     Boolean    CPPTreeApp::DoCommand (short commandID)
  111.     {    
  112.         
  113.         switch (commandID) {
  114.                 
  115.             case kCmdAbout :
  116.                 DoAboutBox();
  117.                 break;
  118.  
  119.             default :
  120.                 return CPPApplication::DoCommand(commandID);
  121.                 break;
  122.         
  123.         }
  124.     }
  125.  
  126.